package com.mantbox.channelcall.utils;

public class ResResult {
    /*状态
     * 状态：1成功，0失败
     * */
    Boolean status;
    /*
     * 消息
     * */
    String msg;
    /*
     * 数据
     * */
    Object data;

    public void setData(Object data) {
        this.data = data;
    }

    public Object getData() {
        return data;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public Boolean getStatus() {
        return status;
    }

    public static ResResult isOk(String msg, Object data){
        ResResult ResResult = new ResResult();
        ResResult.setStatus(true);
        if (msg != null){
            ResResult.setMsg(msg);
        }
        if (data != null){
            ResResult.setData(data);
        }
        return ResResult;
    }
    public static ResResult isError(String msg){
        ResResult ResResult = new ResResult();
        ResResult.setStatus(false);
        if (msg != null){
            ResResult.setMsg(msg);
        }
        return ResResult;
    }
}
